package com.tuanzi.loan.business.service.family.impl;

import com.tuanzi.loan.business.repository.family.FeedbackRepository;
import com.tuanzi.loan.business.service.family.FeedbackService;
import com.tuanzi.loan.core.vo.PageSearcher;
import com.tuanzi.loan.vo.request.family.FeedbackSearchRequest;
import com.tuanzi.loan.vo.response.family.FeedbackSearchResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Service;

/**
 * @Auther: 钟富澎
 * @Date: 2019/7/16
 * @Description:
 */
@Service
public class FeedbackServiceImpl implements FeedbackService {

    @Autowired
    private FeedbackRepository repository;

    @Override
    public Page<FeedbackSearchResponse> list(PageSearcher<FeedbackSearchRequest> pageSearcher) {
        return repository.list(pageSearcher.getSearchCondition(), pageSearcher.getPageable());
    }

    @Override
    public void resolve(Integer id) {
        repository.updateIsResolved(id, (byte) 1);
    }

    @Override
    public void delete(Integer id) {
        repository.delete(id);
    }
}
